package com.kly.enums;

import java.util.ArrayList;
import java.util.List;

public enum Benefits {
//    FLASH_CHAT(1, "直接会话"),

//    PRIVATE_PHOTO(2, "私密相册"),

//    PRIVATE_VIDEO(3, "私密视频"),

//    WHO_LIKES_ME(6,"谁喜欢我"),
    FLASH_CHAT(1, 1, "Flash_chat"),
    VIEW_PRIVATE_PHOTOS(2, 2, "View_private_photos"),
    VIEW_PRIVATE_VIDEOS(3, 3, "View_private_videos"),
    PRIVATE_ALBUM_MANAGEMENT(4, 4, "Private_album_management"),
    NUMBER_OF_USERS_LIKED(5, 5, "Number_of_users_liked"),
    SESSION_MESSAGE_LIMIT(6, 6, "Session_message_limit"),
    NUMBER_OF_USERS_BROWSED(7, 7, "Number_of_users_browsed"),
    WHO_LIKES_ME(8, 8, "Who_likes_me"),
    EXCLUSIVE_PREMIUM_BADGE(9, 9, "Exclusive_Premium_Badge"),
    ICE_BREAKING_SESSION(10, 10, "Ice_breaking_session"),
    EFFECTIVE_SESSION(11, 11, "Effective_session"),
    DEEP_SESSION(12, 12, "Deep_session"),
    EFFECTIVE_CONVERSATIONS(5, 11, "有效会话数"),
    DEEP_CONVERSATIONS(30, 12, "深度会话数"),
//    PRIVATE_CONVERSATIONS(10, 0, "私密会话数"),



    ;
    private int limit;

    private int benefitCode;
    /**
     *
     */
    private String benefitName;

    Benefits(int limit, int benefitCode, String benefitName) {
        this.limit = limit;
        this.benefitCode = benefitCode;
        this.benefitName = benefitName;
    }

    public static Benefits fromType(int code) {
        if (code == 0) {
            return null;
        }
        for (Benefits benefits : values()) {
            if (benefits.getBenefitCode() == code) {
                return benefits;
            }
        }
        return null;
    }

    public static List<Benefits> getAllBenefits() {
        List<Benefits> allBenefits = new ArrayList<>();
        for (Benefits benefits : values()) {
            allBenefits.add(benefits);
        }
        return allBenefits;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public String getBenefitName() {
        return benefitName;
    }

    public void setBenefitName(String benefitName) {
        this.benefitName = benefitName;
    }

    public int getBenefitCode() {
        return benefitCode;
    }

    public void setBenefitCode(int benefitCode) {
        this.benefitCode = benefitCode;
    }
}
